Skip to content

feat: add sharing debug information option to main settings screen - WPB-24712#4677

Open
netbe wants to merge 32 commits intodevelopfrom
feat/add-share-debug
Open

feat: add sharing debug information option to main settings screen - WPB-24712#4677
netbe wants to merge 32 commits intodevelopfrom
feat/add-share-debug

Conversation

@netbe
Copy link
Copy Markdown
Collaborator

@netbe netbe commented May 6, 2026

TaskWPB-24712 [iOS] Add Sharing Debug information option to main settings page

Issue

This PR reworks how sharing debug information is presented to users. It's now accessible :

  1. in the main settings screen (banner)
  2. shake gesture to present
  • Add developer flag to test the gesture on internalBuilds:

Default behaviour: it still shows the DeveloperTools screen. If the Developer flag is on, it shows the action sheet. Shake again to present the DeveloperTools.
On production it only shows the action sheet.

  • Mail body reworked
  • Removed the debug report from the Advanced section
  • Rework responsabilities of LogsProvider: moved the creation of zip log or data for mail to a dedicated useCase.
  • Updated usage on Block

Testing

  • Added UI test

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

present(deleteDatabaseConfirmationAlert, animated: true)
}

func mailComposeController(
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: check this change

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – WireUIAll

  1 files   41 suites   1m 11s ⏱️
161 tests 159 ✅ 1 💤 1 ❌
161 runs  160 ✅ 1 💤 0 ❌

For more details on these failures, see this check.

Results for commit 86bd0f7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – WireFoundationAll

47 tests   47 ✅  10s ⏱️
11 suites   0 💤
 1 files     0 ❌

Results for commit 86bd0f7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – Wire-iOS

1 881 tests   1 854 ✅  2m 11s ⏱️
  300 suites     27 💤
    1 files        0 ❌

Results for commit 86bd0f7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – WireLoggingAll

4 tests   4 ✅  0s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 86bd0f7.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Test Results – WireUtilities

280 tests   280 ✅  6s ⏱️
 46 suites    0 💤
  1 files      0 ❌

Results for commit 86bd0f7.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link
Copy Markdown

datadog-wireapp Bot commented May 6, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 86bd0f7 | Docs | Give us feedback!

@netbe netbe requested review from David-Henner and samwyndham May 6, 2026 13:50
let isOn = keyAndValue[1] == "true"
flag.enable(isOn)
}
#if DEBUG
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set developerFlags passed from XCUITest

private var defaultRecordMode: SnapshotTestingConfiguration.Record? {
let ci = ProcessInfo.processInfo.environment["CI"]
return (ci == nil || ci?.isEmpty == true) ? .missing : .never
if let value = ProcessInfo.processInfo.environment["SNAPSHOT_TESTING_RECORD"],
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now, it reads the env variable from the testplan first so if you need to record snapshots you can just modify the env value to failed and not remove the file manually

@netbe netbe changed the title feat: Add Sharing Debug information option to main settings page - WPB-24712 feat: add sharing debug information option to main settings screen - WPB-24712 May 6, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

@samwyndham samwyndham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. I left some comments before approving

"enabled" : false,
"key" : "SNAPSHOT_TESTING_RECORD",
"value" : "failed"
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Interesting. Does this mean that if we set it to true it will recreate the failing snapshots for us?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: OK so the change here is the color of the tab bar right? Was this indended?

// MARK: - setUp / tearDown

override func setUp() async throws {
tempDirectory = URL(fileURLWithPath: NSTemporaryDirectory())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit pick: You can also do: URL.temporaryDirectory

/// Style iOS & Figma: ?
case largeTitle

/// Style iOS & Figma: Title 3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Adding comments here. I guess at some point we should rename things to match Figma design system if it is up-to-date

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought (out of scope): This test looks weird. I hope our tab bar never looks like that in reality

/// On XCUITests, shake gesture is not available.
public var useTripleTapForShakeGesture = true

/// Developer flags to apply at launch, keyed by `DeveloperFlag.rawValue`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: I wonder if we should move DeveloperFlag to WirePrimitives so that we can pass them directly instead of their string values.


import XCTest

final class ShareDebugReportTests: WireUITestCase {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Adding UI tests


/// When `true`, a triple-tap on the app window triggers the same action as the shake gesture.
/// On XCUITests, shake gesture is not available.
public var useTripleTapForShakeGesture = true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Have this disabled by default and only enable it in the setup of the UITests that use it.

issue(maybe): I was looking at UITestConfig yesterday and realized that we should change something... Currently if UITestConfig.environment returns a default if it is not set in the environment. I think it should return nil. I think the in the current implementation any kind of debug build will have useTripleTapForShakeGesture, not just UI tests

}
}

func simulateShakeGesture() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Extend and apply to XCUIApplication instead of WireUITestCase

}

func invoke() async throws -> URL {
try await withCheckedThrowingContinuation { [logsProvider, selfUserID] continuation in
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why is this being doing using GCD?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants